/**
 * API版本请求模块
 */

import request from '@/utils/request'

export const ApiVersionPageList = (name: any) => { // 获取版本列表
  return request<any>({
    method: 'GET',
    url: `/serverGovernance/api/v1alpha1/namespaces/default/archives/${name}`
  })
}

export const ApiOperationService = (name: any) => { // 查询所属应用
  return request<any>({
    method: 'GET',
    url: `/serverGovernance/api/operation/service?name=${name}`
  })
}

export const ApiOperationOperator = (name: any) => { // 查询运维人员
  return request<any>({
    method: 'GET',
    url: `/serverGovernance/api/operation/operator?name=${name}`
  })
}

export const ApiArchivesVersion = (data: any) => { // 查询版本协议
  return request<any>({
    method: 'GET',
    url: `/serverGovernance/api/protocol/namespaces/${data.namespace}/archives/${data.apiName}/versions/${data.version}`
  })
}

// 更新api信息
export const UpdateProtocol = (data: any) => {
  return request<any>({
    method: 'PUT',
    url: `/serverGovernance/api/protocol/archives`,
    data
  })
}



